//
//  QueryDimListVC.m
//  CJRailTransport
//
//  Created by Hank on 2018/1/15.
//  Copyright © 2018年 amplity. All rights reserved.
//

#import "QueryDimListVC.h"
#import "QueryDimListCell.h"
#import "QueryCarefulVC.h"

@interface QueryDimListVC ()

@end

@implementation QueryDimListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // 设置导航栏
    [self setNavC];
    // 设置界面属性
    [self setViewAttribute];
    // 注册Cell
    [self registerCells];
}

#pragma mark - 导航栏
- (void)setNavC
{
    self.title = @"查询";
    // 设置导航栏颜色
    BasicNavigationController *nVC = (BasicNavigationController *)self.navigationController;
    nVC.themeColor = [UIColor whiteColor];
    nVC.tintColor = [UIColor darkGrayColor];
}

// 设置界面属性
- (void)setViewAttribute
{
    self.view.backgroundColor = [UIColor whiteColor];
}

// 注册Cell
- (void)registerCells
{
    UINib *nib = [UINib nibWithNibName:[QueryDimListCell reuseIdentifier] bundle:nil];
    [_myTableView registerNib:nib forCellReuseIdentifier:[QueryDimListCell reuseIdentifier]];
}

#pragma mark - TableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    QueryDimListCell *cell = [tableView dequeueReusableCellWithIdentifier:[QueryDimListCell reuseIdentifier] forIndexPath:indexPath];
    cell.indexPath = indexPath;
    cell.index = _index;
    [cell setData:nil];
    return cell;
}

#pragma mark - TableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    QueryCarefulVC *queryCarefulVC = [[QueryCarefulVC alloc]init];
    [self.navigationController pushViewController:queryCarefulVC animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
